<template>
    <div class="ma-content-block lg:flex justify-between p-4">
      <!-- CRUD 组件 -->
      <ma-crud :options="options" :columns="columns" ref="crudRef">
            <template #dept_id="{ record }">
                <!-- 对标题加上 tag -->
                <a-tag color="blue" >{{ record?.order?.dept?.name }}</a-tag>
            </template>
            <template #car_ids="{ record }">
                <!-- 对标题加上 tag -->
                <a-tag color="blue" >{{ record?.driver?.driver_name }}</a-tag>
            </template>
            <template #car_arr="{ record }">
                <!-- 对标题加上 tag -->
                <a-tag color="blue" v-if="record?.car_arr != ''">{{ record?.car_arr }}</a-tag>
            </template>  
			<template #box_arr="{ record }">
                <!-- 对标题加上 tag -->
                <a-tag color="blue" v-if="record?.box_arr != ''">{{ record?.box_arr }}</a-tag>
            </template> 
			
            <template #is_zc="{ record }">
                <!-- 对标题加上 tag -->
                <a-tag :color="record?.is_zc == 1?'blue':'gray'" >{{ record?.is_zc == 1?'已装车':'未装车' }}</a-tag>
            </template>
            <template #operationAfterExtend="{ record }">
				<a-link @click='handlethrough(record)'> 通行记录</a-link>
                <a-link  v-if="record?.is_zc == 1" @click="openPicListcmt(record)" v-auth="['prediction:printLog:getNo']">打印出门条({{ record?.pcount }})</a-link>
            </template>
			<template #summaryCell="{ column, record, rowIndex }">
				{{
				column.dataIndex == "dept_id"
					? "合计"
					: column.dataIndex == "zong_weight"
					? (record[column.dataIndex] - 0).toFixed(3) + '吨'
					: column.dataIndex == "zong_number"
					? record[column.dataIndex] + '件'
					: record[column.dataIndex]
				}}
			</template>
      </ma-crud>

      <!-- 打印出门条-整车 -->
		<a-modal :mask-closable="false"  v-model:visible="showModle_cmt" width="auto" title="威斯腾物流园" ok-text="打印" :footer="false" v-if="showModle_cmt">
			<div v-if='datas.driver_order.transport_type == 2 || (datas.driver_order.transport_type == 1 && rowData.taoxiang == 1)'>
				<div style="display: flex;width: 100%;padding: 0 36px;box-sizing: border-box;">
					<div style="margin-right: 12px; flex: 1">
						<a-form-item label="发货人">
							<a-input v-model="fahuoname" placeholder="请输入发货人" />
						</a-form-item>
					</div>
					<div style="flex: 1">
						<a-form-item label="提货人">
							<a-input v-model="tihuoname" placeholder="请输入提货人" />
						</a-form-item>
					</div>
				</div>
				<div
					style="
						display: flex;
						width: 100%;
						padding: 0 36px;
						box-sizing: border-box;
					"
				>
					<div style="margin-right: 12px; flex: 1">
						<a-form-item label="提货单位">
							<a-input v-model="tihuodanwei" placeholder="请输入提货单位" />
						</a-form-item>
					</div>
					<div style="flex: 1">
						<a-form-item label="提货日期">
							<a-date-picker show-time format="YYYY-MM-DD HH:mm" @ok="onOk" />
						</a-form-item>
					</div>
				</div>

				<div style="width: 210mm; padding: 5mm 36px; box-sizing: border-box" id="crudcontentcmt">
					<div
						style="
							display: flex;
							justify-content: center;
							margin-bottom: 10px;
							position: relative;
						"
					>
						<div>
							<div style="font-size: 14px; text-align: center">
								天一集团威斯腾物流
							</div>
							<div style="font-size: 24px;text-align: center;">物 资 出 门 证</div>
						</div>
						<div
							style="
								position: absolute;
								right: 6px;
								top: 50%;
								transform: translateY(-50%);
							"
						>
							<div style="display: flex; align-items: center; font-size: 18px">
								<div style="font-weight: 600">NoA：</div>
								<div style="width: 80px; color: red">{{ no }}</div>
							</div>
							<div style="display: flex; align-items: center; font-size: 18px">
								<div style="font-weight: 400">车牌号：</div>
								<div style="width: 80px">
									<span style="font-size: 15px">{{ datas.car_no }}</span>
								</div>
							</div>
						</div>
						<div style="position: absolute; left: 0px; top: 0">
							<div>
								<span style="font-size: 18px; color: red">{{ datas.order.order_noe }}</span>
							</div>
						</div>
					</div>
					<div
						style="
							margin-bottom: 10px;
							display: flex;
							justify-content: space-between;
						"
					>
						<div>提货单位：{{ tihuodanwei }}</div>
						<div>装车时间：{{ zhuangcheTime }}</div>
						<div>打印时间：{{ tihuoTime }}</div>
					</div>
					<div style="display: flex; width: 100%; flex-direction: column">
						<div style="flex: 1; margin-bottom: 10px">
							<div style="" class="table">
								<table
									style="width: 100%"
									v-if="datas.driver_order.detail[0].prediction_id != 0"
								>
									<tr style="display: flex">
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>车号</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>物资名称</div>
										</td>
										
										
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>件数</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>重量</div>
										</td>
										<td
											style="
												width: calc((100% / 9));
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>备注</div>
										</td>
									</tr>
									<tr
										v-for="(item, index) in datas.driver_order.detail"
										:key="index"
										style="display: flex"
									>
										<!-- <td style="flex:1;display:flex;justify-content: center;align-items: center;min-height:53px"><div>{{ item.order_no }}</div></td> -->
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.prediction.car_no }}</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.prediction.goods_name }}</div>
										</td>
										
										
										<!-- <td style="flex:1;display:flex;justify-content: center;align-items: center;"><div>{{ item.pick_weight }}</div></td> -->
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.pick_number }}</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.pick_weight }}</div>
										</td>
										<td
											style="
												width: calc((100% / 9));
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div></div>
										</td>

										<!-- <td v-if="item.prediction.transport_type == 2"  style="flex:1;display:flex;justify-content: center;align-items: center;"><div>{{ item.pick_weight }}</div></td> -->
									</tr>
								</table>
								<table
									style="width: 100%"
									v-if="datas.driver_order.detail[0].warehouse_user_detail_id != 0"
								>
									<tr style="display: flex">
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>物资名称</div>
										</td>
										
										
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>仓库</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>产地</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>件数</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>重量</div>
										</td>
										<td
											v-if="datas.order?.transport_type == 1"
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>箱号</div>
										</td>
										<td
											v-if="datas.order?.transport_type == 1"
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												height: 32px;
											"
										>
											<div>箱型箱类</div>
										</td>
									</tr>
									<tr
										v-for="(item, index) in datas.driver_order.detail"
										:key="index"
										style="display: flex"
									>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.wareuserdetail.goods_name }}</div>
										</td>
										
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div v-if="item.wareuserdetail.horizontal_position != ''">
												{{ item.wareuserdetail.warehouse.name }}/{{
													item.wareuserdetail.horizontal_position
												}}-{{ item.wareuserdetail.release_position }}-{{
													item.wareuserdetail.reaches_position
												}}
											</div>
										</td>
										<td
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.wareuserdetail.producer }}</div>
										</td>
										<td
											v-if="datas.order?.transport_type == 2"
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.pick_number }}</div>
										</td>
										<td
											v-if="datas.order?.transport_type == 2"
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ (item.pick_weight - 0).toFixed(3) }}</div>
										</td>
										<td
											v-if="datas.order?.transport_type == 1"
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.wareuserdetail.box }}</div>
										</td>
										<td
											v-if="datas.order?.transport_type == 1"
											style="
												flex: 1;
												display: flex;
												justify-content: center;
												align-items: center;
												min-height: 32px;
											"
										>
											<div>{{ item.wareuserdetail.box_type }}</div>
										</td>
									</tr>
								</table>
							</div>
						</div>

						<div
							style="
								display: flex;
								align-items: center;
								line-height: 14px;
								margin-bottom: 10px;
								justify-content: center;
							"
						>
							<div>①</div>
							<div>（</div>
							<div>白</div>
							<div>）</div>
							<div>威</div>
							<div>斯</div>
							<div>腾</div>
							<div>留</div>
							<div>底</div>
							<div style="width: 4px"></div>
							<div>②</div>
							<div>（</div>
							<div>红</div>
							<div>）</div>
							<div>随</div>
							<div>车</div>
							<div>留</div>
							<div>存</div>
							<div style="width: 4px"></div>
							<div>③</div>
							<div>（</div>
							<div>黄</div>
							<div>）</div>
							<div>门</div>
							<div>卫</div>
							<div>留</div>
							<div>底</div>
						</div>
					</div>

					<div style="display: flex; margin-bottom: 10px">
						<div style="flex: 1">发货人：{{ fahuoname }}</div>
						<div style="flex: 1">提货人：{{ tihuoname }}</div>
						<div style="flex: 1">制单人：{{ user.nickname }}</div>
						<div >复打次数：{{ pcount }}</div>
					</div>
				</div>
				
				<div style="display: flex;margin-bottom: 10px" v-if="old_no != '0000000'">
					<div style="width:100px">作废原因：</div>
					<a-textarea placeholder="请输入作废原因" @focus="handleFocus" v-model="remark" allow-clear :error="errFalg"/>
				</div>
				<div style="display: flex; justify-content: flex-end" >
					<div v-if="old_no != '0000000'">
						<a-button v-print="printObjcmt" type="primary" v-if="remark">打印</a-button>
						<a-button  type="primary" v-if="!remark" @click="handlePrint">打印</a-button>
					</div>
					<!-- -->
					<div v-if="old_no == '0000000'">
						<a-button v-print="printObjcmt" type="primary" >打印</a-button>
					</div>
					
				</div>
			</div>
			<jzx_model v-if='datas.driver_order.transport_type == 1 && rowData.taoxiang == 0' :row="rowData" :no="no" :remark="jzxPop.remark" :errFalg="jzxPop.errFalg" :old_no="old_no"  :tihuoTime="tihuoTime" @bianhua="handleBian" @gengxin="handleEmit"></jzx_model>
		</a-modal>
		<a-drawer :footer="false" :width="1400" v-model:visible="throughShow">
			<template #title> 通行记录 </template>
			<through ref="throughRef" :plateNo="plateNo" v-if="throughShow"/>
		</a-drawer>
    </div>
  </template>
  <script setup>
  import { ref, reactive,defineProps } from 'vue'
  import predictionOrderCar from '@/api/prediction/predictionOrderCar'
  import predictionDeriverOrder from "@/api/prediction/predictionDeriverOrder";
  import through from '../through/through.vue'
  import { Message } from '@arco-design/web-vue'
  import { Notification } from '@arco-design/web-vue';
  import jzx_model from "./jzx_model.vue";
  import tool from '@/utils/tool'
  import * as common from '@/utils/common'
  import { useUserStore } from "@/store";
  const userStore = useUserStore();
  const user = userStore.user;
  const showModle_cmt = ref(false)
  const tihuoname = ref();
  const fahuoname = ref();
  const tihuoTime = ref();
  const zhuangcheTime = ref()
  const tihuodanwei = ref();
  const pcount  = ref(0)
  const no = ref()
  const old_no = ref()
  const rowData = ref({})
  const jzxPop = ref({})
  const plateNo = ref(null)
  const throughShow = ref(false)
  jzxPop.value = {
	errFalg:false,
	remark:'',
  }
  let datas = [];
  const crudRef = ref()
  const remark = ref()
  const errFalg = ref(false)
//   const handleDel = (row) =>{  // 删除
//     predictionOrderCar.deletes({id:row.id}).then(res=>{
//       if(res.code == 200){
//         Notification.success('删除成功')
//         crudRef.value.refresh()
//       }
//     })
//   }
	const handlethrough = (row)=>{
		console.log(row)
		plateNo.value = row.car_no
		throughShow.value = true
	}
	const handleFocus = ()=>{
		errFalg.value = false
	}
	const handlePrint = ()=>{
		if(!remark.value){
			Message.error('请输入作废原因');
			errFalg.value = true
		}
	}
	const handleBian = (obj)=>{
		jzxPop.value.errFalg = obj.errFalg
		jzxPop.value.remark = obj.remark
	}
	const handleEmit = ()=>{
		showModle_cmt.value = false;
		crudRef.value.refresh();
	}
    const printObjcmt = {
		id: "crudcontentcmt",
		popTitle: "页面打印",
		openCallback(vue) {
			showModle_cmt.value = false;
			predictionDeriverOrder
				.getprintSave({ type: 2, link_id: datas.driver_order.id,remark:remark.value })
				.then((res) => {
					crudRef.value.refresh()
				});
		},
	};
    const onOk = (dateString, date) => {
		tihuoTime.value = dateString;
	};
    const openPicListcmt = (row)=>{
		if(row.driver_order.deriver_pay_status != 1){
			return Message.error('装车单状态错误，无法打印！')
		}
        let arr = [];
		let obj = JSON.parse(JSON.stringify(row));
		if (obj.driver_order.detail[0].prediction_id != 0) {
			obj.driver_order.detail.push({
				prediction: {
					car_no: "合计",
					goods_name: "",
					remark: "",
					box: "",
					box_type: "",
				},
				pick_number: obj.zong_number,
				pick_weight: obj.zong_weight,
			});
		} else if (obj.driver_order.detail[0].warehouse_user_detail_id != 0) {
			obj.driver_order.detail.push({
				wareuserdetail: {
					goods_name: "合计",
					box: "",
					box_type: "",
					warehouse: { name: "" },
					horizontal_position: "",
					release_position: "",
					reaches_position: "",
				},
				pick_number: obj.zong_number,
				pick_weight: obj.zong_weight,
			});
		}
		if(row.driver_order != null){
            if(row.driver_order.transport_type == 1){   //  集装箱
				let boxArr = []
				let box_typeArr = []
				let ticket_number = ''
				let taoxiang = 0
				row.driver_order.detail.map((v,i)=>{
					if(v.prediction_id != 0){
						boxArr.push(v.prediction.box.box)
						taoxiang = v.prediction.box.is_taoxiang
						box_typeArr.push(v.prediction.box_type)
						ticket_number = v.prediction.ticket_number
					}else{
						boxArr.push(v.wareuserdetail.box.box)
						taoxiang = v.wareuserdetail.box.is_taoxiang
						box_typeArr.push(v.wareuserdetail.box_type)
						ticket_number = v.wareuserdetail.prediction.ticket_number
					}
				})
				row.driver_order.boxs = boxArr.join(',')
				row.driver_order.box_types = box_typeArr.join(',')
				row.driver_order.ticket_number = ticket_number
				row.driver_order.taoxiang = taoxiang
				row.driver_order.dept = row.order.dept
				rowData.value = row.driver_order
				console.log(rowData.value)
			}
        }
		datas = obj;
		console.log('datas:',datas)
		predictionDeriverOrder.getGerNo({
			driver_order_id: obj.driver_order.id
		}).then((res) => {
			no.value = res.data.no;
			old_no.value = res.data.old_no;
			fahuoname.value = row.driver_order.create_user.nickname
			tihuoname.value = row.car.driver_name
			tihuodanwei.value = row.order.dept.name
			pcount.value = row.pcount
			tihuoTime.value = tool.dateFormat(
			Math.round(new Date().getTime() / 1000).toString(),
			"yyyy-MM-dd hh:mm:ss"
		);
			zhuangcheTime.value = row.created_at
			showModle_cmt.value = true;
			remark.value = ''
		});
  }

  
  const numberOperation = (newValue, id, numberName) => {
    predictionOrderCar.numberOperation({ id, numberName, numberValue: newValue }).then( res => {
      res.success && Message.success(res.message)
    }).catch( e => { console.log(e) } )
  }
  
  const switchStatus = (statusValue, id, statusName) => {
    predictionOrderCar.changeStatus({ id, statusName, statusValue }).then( res => {
      res.success && Message.success(res.message)
    }).catch( e => { console.log(e) } )
  }
  
  
  const options = reactive({
    id: 'flyos_prediction_order_car',
    rowSelection: {
      showCheckedAll: true
    },
    pk: 'id',
    autoRequest:true,
	searchColNumber:6,
    operationColumn:true,
    isDbClickEdit:false,
    operationColumnWidth: 250,
	showSummary: true,
	summary: [
		{
			dataIndex: "zong_number",
			action: "sum",
		},
		{
			dataIndex: "zong_weight",
			action: "sum",
		},
		
	],
    formOption: {
      viewType: 'modal',
      width: 600
    },
    api: predictionOrderCar.getList,
    recycleApi: predictionOrderCar.getRecycleList,
    add: {
      show: false,
      api: predictionOrderCar.saveDriver,
      auth: ['prediction:order:saveDriver']
    },
    edit: {
      show: false,
      api: predictionOrderCar.update,
      auth: ['prediction:orderCar:update']
    },
    delete: {
      show: false,
      api: predictionOrderCar.deletes,
      auth: ['prediction:orderCar:delete'],
      realApi: predictionOrderCar.realDeletes,
      realAuth: ['prediction:orderCar:realDeletes']
    },
    recovery: {
      show: false,
      api: predictionOrderCar.recoverys,
      auth: ['prediction:orderCar:recovery']
    },
    import: {
      show: false,
      url: 'prediction/orderCar/import',
      templateUrl: 'prediction/orderCar/downloadTemplate',
      auth: ['prediction:orderCar:import']
    },
    export: {
      show: true,
      url: 'prediction/orderCar/export',
      auth: ['prediction:orderCar:export']
    },
    beforeRequest: (params) => {
        params.order = 'created_at'
        params.orderType = 'desc'
    },
    afterRequest: (params) => {
      params.map((v, i) => {
        v.car_ids = v.car_id
		v.images = v?.driver_order?.images.split(',') || []
		console.log(v.images)
        let goods_name = []
        let car_arr = []
		let box_arr = []
        let zong_number = 0
        let zong_weight = 0
		v.order_no = v.order.order_no
        if(v.driver_order != null){
            v.driver_order.detail.map((vv,ii)=>{
                if(vv.prediction_id != 0 && vv.prediction != null){
                    zong_number += (vv.pick_number - 0)
                    zong_weight += (vv.pick_weight - 0)
                    goods_name.push(vv.prediction.goods_name)
                    car_arr.push(vv.prediction.car_no)
					if(vv.prediction.box != null){
						box_arr.push(vv.prediction.box.box)
					}
                }
                if(vv.warehouse_user_detail_id != 0){
                    zong_number += (vv.pick_number - 0)
                    zong_weight += (vv.pick_weight - 0)
                    goods_name.push(vv.wareuserdetail.goods_name)
                    car_arr.push(vv.wareuserdetail.car_no)
					if(vv.wareuserdetail.box != null){
						box_arr.push(vv.wareuserdetail.box.box)
					}
                }
            })
            v.is_zc = 1
        }else{
            v.is_zc = 2
        }
        v.goods_name = goods_name.join(',')
        v.car_arr = car_arr.join(',')
        v.box_arr = box_arr.join(',')
        v.zong_number = zong_number
        v.zong_weight = zong_weight.toFixed(3)
        v.dept_id = v.order.dept_id
		v.mobile = v.driver.mobile
      });
    },
  })
  
  const columns = reactive([
    {
      title: "ID",
      dataIndex: "id",
      formType: "input",
      addDisplay: false,
      editDisplay: false,
      hide: true,
      commonRules: {
        required: true,
        message: "请输入ID"
      }
    },
    {
      title: '所属公司',
      dataIndex: 'dept_id',
      align: "center",
      formType: 'select',
      width:160,
      fixed: "left",
      search: true,
      dict: {
			// 远程通用接口请求，新版代码生成都有一个 remote 接口
			remote: "system/dept/remote",
			// 指定组件接收的props
			props: { label: "name", value: "id" },
			// 开启分页
			openPage: false,
			// 远程请求配置项
			remoteOption: {
				// 按用户名排序
				sort: { id: "desc" }, // 如果不指定排序方式，默认为正序排序
				// 设置查询的字段
				select: ["id", "name"],
				// 设置数据过滤
				filter: {
					type: ["=", 2],
					status: ['=',1]
				},
				// 关联模型
				relations: [],
			},
		},
    },
    {
      title: '订单号',
      dataIndex: 'order_no',
      align: "center",
      formType: 'input',
      width:160,
      fixed: "left",
      search: true,
      addDisplay: false,
      editDisplay: false,
    },
    {
      title: '车号',
      dataIndex: 'car_arr',
      align: "center",
      formType: 'input',
      width:120,
      fixed: "left",
	  search: true,
      addDisplay: false,
      editDisplay: false,
    },
	
    {
      title: '电话号码',
      dataIndex: 'mobile',
      align: "center",
      formType: 'input',
      width:140,
      search: true,
      fixed: "left",
      addDisplay: false,
      editDisplay: false,
    },
    {
		title: "提货类型",
		dataIndex: "driver_order.pick_type",
		formType: "select",
		align: "center",
		search: true,
		commonRules: {
			required: true,
			message: "请输入对装类型",
		},
		dict: {
			name: "pick_type",
			props: {
				label: "title",
				value: "key",
			},
			translation: true,
			tagColors: {
				1: "blue",
				2: "blue",
			},
		},
	},
    {
    title: '绑定司机',
    dataIndex: 'car_ids',
    align: "center",
    formType: 'input',
    },
    {
      title: '装车车牌号',
      dataIndex: 'car_no',
      align: "center",
      formType: 'input',
      search: true,
      addDisplay: false,
      editDisplay: false,
    },
	{
      title: '箱号',
      dataIndex: 'box_arr',
      align: "center",
      formType: 'input',
      width:120,
	  search: true,
      addDisplay: false,
      editDisplay: false,
    },
    {
      title: '品名',
      dataIndex: 'goods_name',
      align: "center",
      formType: 'input',
      width:200,
      addDisplay: false,
      editDisplay: false,
    },
    
    {
      title: '是否装车',
      dataIndex: 'is_zc',
      align: "center",
      formType: 'input',
      addDisplay: false,
      editDisplay: false,
    },
	{
		title: "订单状态",
		dataIndex: "driver_order.deriver_pick_status",
		formType: "select",
		align: "center",
		align: "center",
		search: true,
		commonRules: {
			required: true,
			message: "请输入对装类型",
		},
		dict: {
			name: "deriver_pick_status",
			props: {
				label: "title",
				value: "key",
			},
			translation: true,
			tagColors: {
				1: "grey",
				2: "blue",
				3: "green",
			},
		},
	},
	{
		title: "装车图片",
		dataIndex: "images",
		formType: "upload",
		width:160,
		align: "center",
	},
    {
      title: '提取件数',
      dataIndex: 'zong_number',
      align: "center",
      formType: 'input',
      width:100,
      addDisplay: false,
      editDisplay: false,
    },
    {
      title: '提取重量',
      dataIndex: 'zong_weight',
      align: "center",
      width:100,
      formType: 'input',
      addDisplay: false,
      editDisplay: false,
    },
	// {
    //   title: "入园时间",
    //   dataIndex: "come_time",
    //   formType: "range",
    //   align: "center",
    //   addDisplay: false,
    //   editDisplay: false,
    //   search: true,
    //   width:180,
    //   showTime: true
    // },
    {
      title: "装车时间",
      dataIndex: "driver_order.created_at",
      formType: "range",
      align: "center",
	  sortable: { sortDirections: ['ascend', 'descend'],  },
      addDisplay: false,
      editDisplay: false,
      search: true,
      width:180,
      showTime: true
    },
	// {
    //   title: "离园时间",
    //   dataIndex: "leave_time",
    //   formType: "range",
    //   align: "center",
    //   addDisplay: false,
    //   editDisplay: false,
    //   search: true,
    //   width:180,
    //   showTime: true
    // },
    {
      title: "创建时间",
      dataIndex: "created_at",
      formType: "date",
      align: "center",
      addDisplay: false,
      editDisplay: false,
      width:180,
      showTime: true
    }
  ])
  defineExpose({ open })
  </script>
  <style>
  .table,
	th,
	tr,
	td {
		padding: 0px;
		box-sizing: border-box;
		text-align: center;
		font-size: 14px;
		line-height: 20px;
	}
	.table {
		border-top: 1px solid rgba(0, 0, 0);
		border-left: 1px solid rgba(0, 0, 0);
		width: 100%;
	}
	.table td {
		padding: 6px 10px;
		word-break: break-all;
		word-wrap: break-word;
	}
	.table tr td {
		border-right: 1px solid rgba(0, 0, 0);
		border-bottom: 1px solid rgba(0, 0, 0);
	}
  .arco-picker-size-medium {
      flex: 1;
  }
</style>
  <script> export default { name: 'prediction:orderCar' } </script>